package com.zhong.bmob.server;

import com.zhong.bmob.inter.IUpdate;

import cn.bmob.v3.BmobObject;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.UpdateListener;

/**
 * Created by 俊峰 on 2017/5/26.
 */

public class Update {
    public static void UpdateBmob(String objectId, BmobObject object, IUpdate update){
        final IUpdate mUpdate = update;
        object.update(objectId, new UpdateListener() {
            @Override
            public void done(BmobException e) {
                if (e == null){
                    mUpdate.UpdateSuccess();
                }else {
                    mUpdate.UpdateFailed();
                }
            }
        });
    }
}
